package com.zxx.pattern.visitorPattern;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.zxx.designpattern.R;
import com.zxx.injectandroid.SimpleDagger;
import com.zxx.libinject.anno.ViewInjector;

public class MainInjectActivity extends AppCompatActivity {

    @ViewInjector(R.id.my_tv)
    TextView mTextView;

    @ViewInjector(R.id.my_tv2)
    protected TextView mTextView2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_inject);

        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new TestInjectFragment())
                .commit();

        SimpleDagger.inject(this);

        if (mTextView != null) {
            Log.e("Tag-->", "### my text view : " + mTextView.getText());
        }
    }
}